package com.sscw.task.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.sscw.task.constant.DeviceStatusEnum;
import com.sscw.task.constant.RoomTypeEnum;
import com.sscw.task.entity.GConfDevicePO;
import com.sscw.task.mapper.GConfDeviceMapper;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public class GConfDeviceDAO extends BaseDAO<GConfDeviceMapper, GConfDevicePO> {

    public List<GConfDevicePO> findAllPushCoinsUse() {
        LambdaQueryWrapper<GConfDevicePO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(GConfDevicePO::getDeviceType, RoomTypeEnum.push_coins.getCode());
        queryWrapper.eq(GConfDevicePO::getStatus, DeviceStatusEnum.hold.getCode());
        return getBaseMapper().selectList(queryWrapper);
    }
}
